using System.Data;

namespace TaskKernel.Domain.Nhibernate.NHibernateLayer
{
    public class UnitOfWorkFactory : IUnitOfWorkFactory
    {
        private ISessionProvider sessionProvider;
        public UnitOfWorkFactory(ISessionProvider sessionProvider)
        {
            this.sessionProvider = sessionProvider;
        }
        public IUnitOfWork Create(IsolationLevel isolationLevel = IsolationLevel.Unspecified)
        {
            return new _UnitOfWork(sessionProvider.Current.BeginTransaction(isolationLevel));
        }

    }
}